$(function($){
	
	/*汉字*/
	$.validator.addMethod("chinese",function(value,element){
		var index = value.search(/^([\u4E00-\u9FA5])+$/);
		if(index != -1){
			return false;
		}
		return true;
	});
	
	/*小写字母*/
	$.validator.addMethod("smallLetter",function(value,element){
		var index = value.search(/^[a-z]+$/);
		if(index != -1){
			return false;
		}
		return true;
	});
	
	/*小写字母*/
	$.validator.addMethod("bigLetter",function(value,element){
		var index = value.search(/^[A-Z]+$/);
		if(index != -1){
			return false;
		}
		return true;
	});
	
	/*字母*/
	$.validator.addMethod("bigLetter",function(value,element){
		var index = value.search(/^[a-zA-Z]+$/);
		if(index != -1){
			return false;
		}
		return true;
	});
	
	/*字母或者数字*/
	$.validator.addMethod("letterOrNum",function(value,element){
		var index = value.search(/^[a-zA-Z0-9]+$/);
		if(index != -1){
			return false;
		}
		return true;
	});
	
	/*正整数*/
	$.validator.addMethod("letterOrNum",function(value,element){
		var index = value.search(/^\+?[1-9][0-9]*$/);
		if(index != -1){
			return false;
		}
		return true;
	});
	
	/*整数*/
	$.validator.addMethod("letterOrNum",function(value,element){
		var index = value.search(/^\d+$/);
		if(index != -1){
			return false;
		}
		return true;
	});
	
	/*中文长度*/
	$.validator.addMethod("chineseMaxLength", function(value, element, param){
		return (getChineseCount(value) <= param);
	});
	
	//校验特殊字符
	$.validator.addMethod("specicalLetter", function(value, element){
		var index = value.search(/[`~!@#$%^&*()+=|{}':;',\[\].<>?~！@#￥%……&*（）——+|{}【】‘；：”“’。，、？]/);
		if(index != -1){
			return false;
		}
		return true;
	});
	
	/*手机号码*/
	$.validator.addMethod("isMobile", function(value, element){
		if(value==null || value==''){
			return true;
		}
		var m = /^((13[0-9])|(15[^4,\D])|(18[0-9])|(17[0-9])|(147))\d{8}$/;
		return m.exec(value) ? true : false;
	},"手机号格式错误");
	
	/*手机或者电话号码*/
	$.validator.addMethod("phone", function(value, element){
		var m = /^((13[0-9])|(15[^4,\D])|(18[0-9])|(17[0-9])|(147))\d{8}$/;
		if(m.exec(value)){
			return true;
		}
		var p1=/^[0][1-9][0-9]{1,3}-[0-9]{5,10}$/;
		var customer =/^(400|800)[0-9]{7}$/;
		var p2=/^[1-9]{1}[0-9]{5,8}$/;
		if(value.length>9){
			return (p1.exec(value)||customer.exec(value)) ? true : false;
		}else{
			return p2.exec(value) ? true : false;
		}
	});
	
	//判断是否包含‘null’
	$.validator.addMethod("nullStr", function(value, element){
		value = value.replace(/(^\s*)|(\s*$)/g, '');
		if(value == 'null'){
			return false;
		}
		return true;
	});
	
	
});